package com.devsoft.foodfrenzy;

import org.andengine.entity.sprite.TiledSprite;
import com.badlogic.gdx.physics.box2d.Body;


public class Player {
	private int player_id;//For multiplayer
	private int player_pos;
	private int score;
	private int player_rot;//Left(1) or Right(0)
	private int powerup_state;
	private boolean is_dead;
	private TiledSprite image;
	private Body body;
	
	public Player(int id, int pos, TiledSprite img){
		this.player_id=id;
		this.player_pos=pos;
		this.image=img;
		this.score=0;
		this.is_dead=false;
		this.powerup_state=0;
		this.image.setCurrentTileIndex(1);
		this.player_rot = 1;
		}
	
	public void rotate(){
		if(this.player_rot == 0){
			this.image.setCurrentTileIndex(1);
			this.player_rot = 1;
		}
		else if(this.player_rot == 1){
			this.image.setCurrentTileIndex(0);
			this.player_rot = 0;
		}
	}
	
	public void changeSprite(int index){
		this.image.setCurrentTileIndex(index);
	}
	
	public int getID(){
		return player_id;
	}
	
	public int getPosition(){
		return player_pos;
	}
	
	public void setPosition(int pos){
		this.player_pos=pos;
	} 
	
	public int getRotation(){
		return player_rot;
	}
	
	public void setRotation(int rot){
		this.player_rot=rot;
	} 
	
	public int getScore(){
		return score;
	}
	
	public void setScore(int points){
		this.score+=points;
	}
	
	public int getPowerUpState(){
		return powerup_state;
	}
	
	public void setPowerUpState(int state){
		this.powerup_state=state;
	}
	
	public boolean getDeadState(){
		return is_dead;
	}
	
	public void setDeadState(boolean state){
		this.is_dead=state;
	}
	
	public void setBody(Body body)
	{
		this.body = body;
		
	}
	
	public Body getBody()
	{
		return body;
	}
	
	public TiledSprite getSprite(){
		return image;
	}

}
